# -*- coding: utf-8 -*-
from django.test import TestCase
from django.core import mail

class EmailTest(TestCase):

    fixtures = ['test_data']

    def test_send_email(self):
        # Send message.
        mail.send_mail('Subject here', 'Here is the message.',
            'from@example.com', ['to@example.com'],
            fail_silently=False)

        # Test that one message has been sent.
        self.assertEquals(len(mail.outbox), 1)

        # Verify that the subject of the first message is correct.
        self.assertEquals(mail.outbox[0].subject, 'Subject here')
